package com.wcll.www;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class GgaoBean {
	private int id;
	private int cor_id;
	private String lujing;
	private static Connection con = null;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getCor_id() {
		return cor_id;
	}
	public void setCor_id(int cor_id) {
		this.cor_id = cor_id;
	}
	public String getLujing() {
		return lujing;
	}
	public void setLujing(String lujing) {
		this.lujing = lujing;
	}
	public static Connection getCon() throws ClassNotFoundException, SQLException {
		if(con==null){
			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection("jdbc:mysql://localhost/jobs?useUnicode=true&characterEncoding=UTF8","root","");
		}
		return con;
	}
	public static void setCon(Connection con) {
		GgaoBean.con = con;
	}
	public String getLuJing(int id){
		String s = null;
		try{
			con = GgaoBean.getCon();
			Statement st = con.createStatement();
			ResultSet rs = st.executeQuery("select * from ad ");
			while(rs.next()){
				s += rs.getString("lujing");
			}
			rs.close();
			st.close();
			con.close();
		}catch(Exception e){}
		return s;
		
	}
}
